<!--
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 14:41:20
 * @LastEditTime: 2023-11-11 15:20:15
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description:   :gridOps="gridOptions" other
-->
<template>
  <el-dialog
    draggable
    overflow
    v-model="visible"
    :title="'查看'"
    :width="800"
    destroy-on-close
    @closed="$emit('closed')"
  >
    <sc-VxeTable
      ref="xGrid"
      :gridEvts="gridEvents"
      :gridOps="gridOps"
      :tablecode="'pro_processes_pass_view'"
      :url="api.pro.processes.pass_list"
      :order="'asc'"
      :sort="'swiped_at'"
      :params="getParams"
    >
    </sc-VxeTable>
  </el-dialog>
</template>
<script>
export default {
  name: "pro_process",
};
</script>
<script setup>
// import { useRouter } from "vue-router";
import { ref } from "vue";
import api from "@/api";
const visible = ref(false);
const xGrid = ref({});

const gridOps = {
  height: 400,
  columns: [
    {
      field: "open_card.customer.name",
      className: "red",
    },
    {
      field: "process.name",
      className: "red",
    },
    {
      field: "material.name",
      className: "blue",
    },
  ],
};
const params = ref(null);
const getParams = () => {
  return params.value == null ? { id: 0 } : params.value;
};
const setData = data => {
  console.log("params", data);
  params.value = data;
  return this;
};
const open = () => {
  visible.value = true;
  return this;
};
const gridEvents = {};
defineExpose({ setData, open });
</script>
